home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / hypercar / xcmd / locale.sit / Locale Package / cards.xml < prev    next >
Encoding:
Text File  |  1991-02-02  |  51.7 KB  |  1,151 lines

  1. card_3026.xml
  2. <?xml version="1.0" encoding="utf-8" ?>
  3. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  4. <card>
  5.     <id>3026</id>
  6.     <filler1>0</filler1>
  7.     <bitmap>BMAP_3863.pbm</bitmap>
  8.     <cantDelete> <false /> </cantDelete>
  9.     <showPict> <true /> </showPict>
  10.     <dontSearch> <false /> </dontSearch>
  11.     <owner>2566</owner>
  12.     <link rel="stylesheet" type="text/css" href="stylesheet_3211.css" />
  13.     <part>
  14.         <id>1</id>
  15.         <type>field</type>
  16.         <visible> <true /> </visible>
  17.         <dontWrap> <false /> </dontWrap>
  18.         <dontSearch> <false /> </dontSearch>
  19.         <sharedText> <false /> </sharedText>
  20.         <fixedLineHeight> <false /> </fixedLineHeight>
  21.         <autoTab> <false /> </autoTab>
  22.         <lockText> <false /> </lockText>
  23.         <rect>
  24.             <left>13</left>
  25.             <top>31</top>
  26.             <right>502</right>
  27.             <bottom>250</bottom>
  28.         </rect>
  29.         <style>transparent</style>
  30.         <autoSelect> <false /> </autoSelect>
  31.         <showLines> <false /> </showLines>
  32.         <wideMargins> <false /> </wideMargins>
  33.         <multipleLines> <false /> </multipleLines>
  34.         <reservedFamily> 0 </reservedFamily>
  35.         <titleWidth>0</titleWidth>
  36.         <icon>0</icon>
  37.         <textAlign>left</textAlign>
  38.         <font>Geneva</font>
  39.         <textSize>12</textSize>
  40.         <textStyle>plain</textStyle>
  41.         <textHeight>16</textHeight>
  42.         <name></name>
  43.         <script></script>
  44.     </part>
  45.     <part>
  46.         <id>6</id>
  47.         <type>field</type>
  48.         <visible> <true /> </visible>
  49.         <dontWrap> <false /> </dontWrap>
  50.         <dontSearch> <false /> </dontSearch>
  51.         <sharedText> <false /> </sharedText>
  52.         <fixedLineHeight> <false /> </fixedLineHeight>
  53.         <autoTab> <false /> </autoTab>
  54.         <lockText> <true /> </lockText>
  55.         <rect>
  56.             <left>279</left>
  57.             <top>259</top>
  58.             <right>403</right>
  59.             <bottom>335</bottom>
  60.         </rect>
  61.         <style>rectangle</style>
  62.         <autoSelect> <false /> </autoSelect>
  63.         <showLines> <false /> </showLines>
  64.         <wideMargins> <false /> </wideMargins>
  65.         <multipleLines> <false /> </multipleLines>
  66.         <reservedFamily> 0 </reservedFamily>
  67.         <titleWidth>0</titleWidth>
  68.         <icon>0</icon>
  69.         <textAlign>center</textAlign>
  70.         <font>Palatino</font>
  71.         <textSize>18</textSize>
  72.         <textStyle>plain</textStyle>
  73.         <textHeight>24</textHeight>
  74.         <name></name>
  75.         <script>on mousedown
  76. visual zoom open
  77. go cd "settimedate"
  78. end mousedown</script>
  79.     </part>
  80.     <part>
  81.         <id>7</id>
  82.         <type>field</type>
  83.         <visible> <true /> </visible>
  84.         <dontWrap> <false /> </dontWrap>
  85.         <dontSearch> <false /> </dontSearch>
  86.         <sharedText> <false /> </sharedText>
  87.         <fixedLineHeight> <false /> </fixedLineHeight>
  88.         <autoTab> <false /> </autoTab>
  89.         <lockText> <true /> </lockText>
  90.         <rect>
  91.             <left>144</left>
  92.             <top>259</top>
  93.             <right>268</right>
  94.             <bottom>335</bottom>
  95.         </rect>
  96.         <style>rectangle</style>
  97.         <autoSelect> <false /> </autoSelect>
  98.         <showLines> <false /> </showLines>
  99.         <wideMargins> <false /> </wideMargins>
  100.         <multipleLines> <false /> </multipleLines>
  101.         <reservedFamily> 0 </reservedFamily>
  102.         <titleWidth>0</titleWidth>
  103.         <icon>0</icon>
  104.         <textAlign>center</textAlign>
  105.         <font>Palatino</font>
  106.         <textSize>18</textSize>
  107.         <textStyle>plain</textStyle>
  108.         <textHeight>24</textHeight>
  109.         <name></name>
  110.         <script>on mousedown
  111. visual zoom open
  112. go cd "setlocale"
  113. end mousedown</script>
  114.     </part>
  115.     <part>
  116.         <id>8</id>
  117.         <type>field</type>
  118.         <visible> <true /> </visible>
  119.         <dontWrap> <false /> </dontWrap>
  120.         <dontSearch> <false /> </dontSearch>
  121.         <sharedText> <false /> </sharedText>
  122.         <fixedLineHeight> <false /> </fixedLineHeight>
  123.         <autoTab> <false /> </autoTab>
  124.         <lockText> <true /> </lockText>
  125.         <rect>
  126.             <left>8</left>
  127.             <top>259</top>
  128.             <right>132</right>
  129.             <bottom>335</bottom>
  130.         </rect>
  131.         <style>rectangle</style>
  132.         <autoSelect> <false /> </autoSelect>
  133.         <showLines> <false /> </showLines>
  134.         <wideMargins> <false /> </wideMargins>
  135.         <multipleLines> <false /> </multipleLines>
  136.         <reservedFamily> 0 </reservedFamily>
  137.         <titleWidth>0</titleWidth>
  138.         <icon>0</icon>
  139.         <textAlign>center</textAlign>
  140.         <font>Palatino</font>
  141.         <textSize>18</textSize>
  142.         <textStyle>plain</textStyle>
  143.         <textHeight>24</textHeight>
  144.         <name></name>
  145.         <script>on mousedown
  146. visual zoom open
  147. go cd "getlocale"
  148. end mousedown</script>
  149.     </part>
  150.     <part>
  151.         <id>13</id>
  152.         <type>button</type>
  153.         <visible> <true /> </visible>
  154.         <reserved5> 0 </reserved5>
  155.         <reserved4> 0 </reserved4>
  156.         <reserved3> 0 </reserved3>
  157.         <reserved2> 0 </reserved2>
  158.         <reserved1> 0 </reserved1>
  159.         <enabled> <true /> </enabled>
  160.         <rect>
  161.             <left>452</left>
  162.             <top>315</top>
  163.             <right>475</right>
  164.             <bottom>337</bottom>
  165.         </rect>
  166.         <style>transparent</style>
  167.         <showName> <false /> </showName>
  168.         <highlight> <false /> </highlight>
  169.         <autoHighlight> <true /> </autoHighlight>
  170.         <sharedHighlight> <true /> </sharedHighlight>
  171.         <family>0</family>
  172.         <titleWidth>0</titleWidth>
  173.         <icon>1014</icon>
  174.         <textAlign>center</textAlign>
  175.         <font>Chicago</font>
  176.         <textSize>12</textSize>
  177.         <textStyle>plain</textStyle>
  178.         <name></name>
  179.         <script>on mouseUp
  180. visual wipe right
  181. go prev cd
  182. end mouseUp</script>
  183.     </part>
  184.     <part>
  185.         <id>14</id>
  186.         <type>button</type>
  187.         <visible> <true /> </visible>
  188.         <reserved5> 0 </reserved5>
  189.         <reserved4> 0 </reserved4>
  190.         <reserved3> 0 </reserved3>
  191.         <reserved2> 0 </reserved2>
  192.         <reserved1> 0 </reserved1>
  193.         <enabled> <true /> </enabled>
  194.         <rect>
  195.             <left>483</left>
  196.             <top>315</top>
  197.             <right>506</right>
  198.             <bottom>337</bottom>
  199.         </rect>
  200.         <style>transparent</style>
  201.         <showName> <false /> </showName>
  202.         <highlight> <false /> </highlight>
  203.         <autoHighlight> <true /> </autoHighlight>
  204.         <sharedHighlight> <true /> </sharedHighlight>
  205.         <family>0</family>
  206.         <titleWidth>0</titleWidth>
  207.         <icon>1013</icon>
  208.         <textAlign>center</textAlign>
  209.         <font>Chicago</font>
  210.         <textSize>12</textSize>
  211.         <textStyle>plain</textStyle>
  212.         <name></name>
  213.         <script>on mouseUp
  214. visual wipe left
  215. go next cd
  216. end mouseUp
  217. </script>
  218.     </part>
  219.     <content>
  220.         <layer>card</layer>
  221.         <id>1</id>
  222.         <text><span class="style2">ocale Package 1.0</span><span class="style1">
  223. </span><span class="style4">by Len Saaf
  224. ┬⌐1991 Raleigh Associates
  225. These XCMDs are free for non-commercial purposes.
  226. </span><span class="style3">
  227. There are three Hypercard XCMDs in this stack. Two read and write the latititude, longitude and time zone information that is stored in the Macintosh's parameter RAM. The third XCMD will set the time and date of the Macintosh should you ever require that done from Hypercard. The Pascal source code is included. The XCMDs return desciption and usage information when called with "!" and "?" respectively.
  228.  
  229. Feedback is welcome. My address is saaf@joker.optics.rochester.edu</span></text>
  230.     </content>
  231.     <content>
  232.         <layer>card</layer>
  233.         <id>6</id>
  234.         <text>
  235. SetTimeDate
  236. XCMD</text>
  237.     </content>
  238.     <content>
  239.         <layer>card</layer>
  240.         <id>7</id>
  241.         <text>
  242. SetLocale
  243. XCMD</text>
  244.     </content>
  245.     <content>
  246.         <layer>card</layer>
  247.         <id>8</id>
  248.         <text>
  249. GetLocale
  250. XCMD</text>
  251.     </content>
  252.     <name></name>
  253.     <script></script>
  254. </card>
  255.  
  256.  
  257. card_3597.xml
  258. <?xml version="1.0" encoding="utf-8" ?>
  259. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  260. <card>
  261.     <id>3597</id>
  262.     <filler1>0</filler1>
  263.     <bitmap>BMAP_4317.pbm</bitmap>
  264.     <cantDelete> <false /> </cantDelete>
  265.     <showPict> <true /> </showPict>
  266.     <dontSearch> <false /> </dontSearch>
  267.     <owner>2566</owner>
  268.     <link rel="stylesheet" type="text/css" href="stylesheet_3211.css" />
  269.     <part>
  270.         <id>2</id>
  271.         <type>field</type>
  272.         <visible> <true /> </visible>
  273.         <dontWrap> <false /> </dontWrap>
  274.         <dontSearch> <false /> </dontSearch>
  275.         <sharedText> <false /> </sharedText>
  276.         <fixedLineHeight> <false /> </fixedLineHeight>
  277.         <autoTab> <false /> </autoTab>
  278.         <lockText> <true /> </lockText>
  279.         <rect>
  280.             <left>5</left>
  281.             <top>24</top>
  282.             <right>508</right>
  283.             <bottom>304</bottom>
  284.         </rect>
  285.         <style>transparent</style>
  286.         <autoSelect> <false /> </autoSelect>
  287.         <showLines> <false /> </showLines>
  288.         <wideMargins> <false /> </wideMargins>
  289.         <multipleLines> <false /> </multipleLines>
  290.         <reservedFamily> 0 </reservedFamily>
  291.         <titleWidth>0</titleWidth>
  292.         <icon>0</icon>
  293.         <textAlign>left</textAlign>
  294.         <font>Palatino</font>
  295.         <textSize>12</textSize>
  296.         <textStyle>plain</textStyle>
  297.         <textHeight>16</textHeight>
  298.         <name></name>
  299.         <script></script>
  300.     </part>
  301.     <part>
  302.         <id>3</id>
  303.         <type>field</type>
  304.         <visible> <true /> </visible>
  305.         <dontWrap> <false /> </dontWrap>
  306.         <dontSearch> <false /> </dontSearch>
  307.         <sharedText> <false /> </sharedText>
  308.         <fixedLineHeight> <false /> </fixedLineHeight>
  309.         <autoTab> <false /> </autoTab>
  310.         <lockText> <true /> </lockText>
  311.         <rect>
  312.             <left>363</left>
  313.             <top>97</top>
  314.             <right>504</right>
  315.             <bottom>299</bottom>
  316.         </rect>
  317.         <style>shadow</style>
  318.         <autoSelect> <false /> </autoSelect>
  319.         <showLines> <false /> </showLines>
  320.         <wideMargins> <false /> </wideMargins>
  321.         <multipleLines> <false /> </multipleLines>
  322.         <reservedFamily> 0 </reservedFamily>
  323.         <titleWidth>0</titleWidth>
  324.         <icon>0</icon>
  325.         <textAlign>left</textAlign>
  326.         <font>Palatino</font>
  327.         <textSize>12</textSize>
  328.         <textStyle>plain</textStyle>
  329.         <textHeight>16</textHeight>
  330.         <name></name>
  331.         <script></script>
  332.     </part>
  333.     <part>
  334.         <id>4</id>
  335.         <type>button</type>
  336.         <visible> <true /> </visible>
  337.         <reserved5> 0 </reserved5>
  338.         <reserved4> 0 </reserved4>
  339.         <reserved3> 0 </reserved3>
  340.         <reserved2> 0 </reserved2>
  341.         <reserved1> 0 </reserved1>
  342.         <enabled> <true /> </enabled>
  343.         <rect>
  344.             <left>42</left>
  345.             <top>306</top>
  346.             <right>145</right>
  347.             <bottom>329</bottom>
  348.         </rect>
  349.         <style>transparent</style>
  350.         <showName> <false /> </showName>
  351.         <highlight> <false /> </highlight>
  352.         <autoHighlight> <true /> </autoHighlight>
  353.         <sharedHighlight> <true /> </sharedHighlight>
  354.         <family>0</family>
  355.         <titleWidth>0</titleWidth>
  356.         <icon>0</icon>
  357.         <textAlign>center</textAlign>
  358.         <font>Chicago</font>
  359.         <textSize>12</textSize>
  360.         <textStyle>plain</textStyle>
  361.         <name></name>
  362.         <script>on mouseUp
  363. GetLocale
  364. put the result into myres
  365. if word 1 of myres is "Error" then
  366. beep
  367. put return &┬¼
  368. "Error returned" & return & return & "XCMD returned:" ┬¼
  369. && myres into tmp
  370. else
  371. put return & "XCMD returned:" && myres & return & return into tmp
  372. put "Latitude:" && abs(item 1 of myres) after tmp
  373. if (item 1 of myres) < 0  then
  374. put " South" after tmp
  375. else
  376. put " North" after tmp
  377. end if
  378. put return & "Longitude:" && abs(item 2 of myres) after tmp
  379. if (item 2 of myres) < 0  then
  380. put " West" after tmp
  381. else
  382. put " East" after tmp
  383. end if
  384. put return & return after tmp
  385. if (item 3 of myres) < 0 then
  386. put abs(item 3 of myres) && "hours behind UTC" after tmp
  387. else
  388. put abs(item 3 of myres) && "hours ahead of UTC" after tmp
  389. end if
  390. end if
  391. put return & return & "Click to hide." after tmp
  392. put tmp into cd fld "results"
  393. show cd fld "results"
  394. end mouseUp</script>
  395.     </part>
  396.     <part>
  397.         <id>5</id>
  398.         <type>button</type>
  399.         <visible> <true /> </visible>
  400.         <reserved5> 0 </reserved5>
  401.         <reserved4> 0 </reserved4>
  402.         <reserved3> 0 </reserved3>
  403.         <reserved2> 0 </reserved2>
  404.         <reserved1> 0 </reserved1>
  405.         <enabled> <true /> </enabled>
  406.         <rect>
  407.             <left>170</left>
  408.             <top>306</top>
  409.             <right>273</right>
  410.             <bottom>329</bottom>
  411.         </rect>
  412.         <style>transparent</style>
  413.         <showName> <false /> </showName>
  414.         <highlight> <false /> </highlight>
  415.         <autoHighlight> <true /> </autoHighlight>
  416.         <sharedHighlight> <true /> </sharedHighlight>
  417.         <family>0</family>
  418.         <titleWidth>0</titleWidth>
  419.         <icon>0</icon>
  420.         <textAlign>center</textAlign>
  421.         <font>Chicago</font>
  422.         <textSize>12</textSize>
  423.         <textStyle>plain</textStyle>
  424.         <name></name>
  425.         <script>on mouseUp
  426. set the scroll of cd fld "source" to 0
  427. show cd fld "source"
  428. end mouseUp</script>
  429.     </part>
  430.     <part>
  431.         <id>6</id>
  432.         <type>button</type>
  433.         <visible> <true /> </visible>
  434.         <reserved5> 0 </reserved5>
  435.         <reserved4> 0 </reserved4>
  436.         <reserved3> 0 </reserved3>
  437.         <reserved2> 0 </reserved2>
  438.         <reserved1> 0 </reserved1>
  439.         <enabled> <true /> </enabled>
  440.         <rect>
  441.             <left>365</left>
  442.             <top>313</top>
  443.             <right>388</right>
  444.             <bottom>335</bottom>
  445.         </rect>
  446.         <style>transparent</style>
  447.         <showName> <false /> </showName>
  448.         <highlight> <false /> </highlight>
  449.         <autoHighlight> <true /> </autoHighlight>
  450.         <sharedHighlight> <true /> </sharedHighlight>
  451.         <family>0</family>
  452.         <titleWidth>0</titleWidth>
  453.         <icon>1014</icon>
  454.         <textAlign>center</textAlign>
  455.         <font>Chicago</font>
  456.         <textSize>12</textSize>
  457.         <textStyle>plain</textStyle>
  458.         <name></name>
  459.         <script>on mouseUp
  460. visual wipe right
  461. go prev cd
  462. end mouseUp</script>
  463.     </part>
  464.     <part>
  465.         <id>7</id>
  466.         <type>button</type>
  467.         <visible> <true /> </visible>
  468.         <reserved5> 0 </reserved5>
  469.         <reserved4> 0 </reserved4>
  470.         <reserved3> 0 </reserved3>
  471.         <reserved2> 0 </reserved2>
  472.         <reserved1> 0 </reserved1>
  473.         <enabled> <true /> </enabled>
  474.         <rect>
  475.             <left>396</left>
  476.             <top>313</top>
  477.             <right>419</right>
  478.             <bottom>335</bottom>
  479.         </rect>
  480.         <style>transparent</style>
  481.         <showName> <false /> </showName>
  482.         <highlight> <false /> </highlight>
  483.         <autoHighlight> <true /> </autoHighlight>
  484.         <sharedHighlight> <true /> </sharedHighlight>
  485.         <family>0</family>
  486.         <titleWidth>0</titleWidth>
  487.         <icon>1013</icon>
  488.         <textAlign>center</textAlign>
  489.         <font>Chicago</font>
  490.         <textSize>12</textSize>
  491.         <textStyle>plain</textStyle>
  492.         <name></name>
  493.         <script>on mouseUp
  494. visual wipe left
  495. go next cd
  496. end mouseUp
  497. </script>
  498.     </part>
  499.     <part>
  500.         <id>8</id>
  501.         <type>button</type>
  502.         <visible> <true /> </visible>
  503.         <reserved5> 0 </reserved5>
  504.         <reserved4> 0 </reserved4>
  505.         <reserved3> 0 </reserved3>
  506.         <reserved2> 0 </reserved2>
  507.         <reserved1> 0 </reserved1>
  508.         <enabled> <true /> </enabled>
  509.         <rect>
  510.             <left>435</left>
  511.             <top>313</top>
  512.             <right>458</right>
  513.             <bottom>335</bottom>
  514.         </rect>
  515.         <style>transparent</style>
  516.         <showName> <false /> </showName>
  517.         <highlight> <false /> </highlight>
  518.         <autoHighlight> <true /> </autoHighlight>
  519.         <sharedHighlight> <true /> </sharedHighlight>
  520.         <family>0</family>
  521.         <titleWidth>0</titleWidth>
  522.         <icon>1012</icon>
  523.         <textAlign>center</textAlign>
  524.         <font>Chicago</font>
  525.         <textSize>12</textSize>
  526.         <textStyle>plain</textStyle>
  527.         <name></name>
  528.         <script>on mouseUp
  529. visual iris close
  530. go first cd
  531. end mouseUp</script>
  532.     </part>
  533.     <part>
  534.         <id>1</id>
  535.         <type>field</type>
  536.         <visible> <false /> </visible>
  537.         <dontWrap> <false /> </dontWrap>
  538.         <dontSearch> <false /> </dontSearch>
  539.         <sharedText> <false /> </sharedText>
  540.         <fixedLineHeight> <false /> </fixedLineHeight>
  541.         <autoTab> <false /> </autoTab>
  542.         <lockText> <true /> </lockText>
  543.         <rect>
  544.             <left>6</left>
  545.             <top>26</top>
  546.             <right>504</right>
  547.             <bottom>334</bottom>
  548.         </rect>
  549.         <style>scrolling</style>
  550.         <autoSelect> <false /> </autoSelect>
  551.         <showLines> <false /> </showLines>
  552.         <wideMargins> <false /> </wideMargins>
  553.         <multipleLines> <false /> </multipleLines>
  554.         <reservedFamily> 0 </reservedFamily>
  555.         <titleWidth>0</titleWidth>
  556.         <icon>0</icon>
  557.         <textAlign>left</textAlign>
  558.         <font>Geneva</font>
  559.         <textSize>9</textSize>
  560.         <textStyle>plain</textStyle>
  561.         <textHeight>12</textHeight>
  562.         <name>source</name>
  563.         <script>on mousedown
  564. hide me
  565. end mousedown</script>
  566.     </part>
  567.     <part>
  568.         <id>9</id>
  569.         <type>field</type>
  570.         <visible> <false /> </visible>
  571.         <dontWrap> <false /> </dontWrap>
  572.         <dontSearch> <false /> </dontSearch>
  573.         <sharedText> <false /> </sharedText>
  574.         <fixedLineHeight> <false /> </fixedLineHeight>
  575.         <autoTab> <false /> </autoTab>
  576.         <lockText> <true /> </lockText>
  577.         <rect>
  578.             <left>102</left>
  579.             <top>71</top>
  580.             <right>423</right>
  581.             <bottom>257</bottom>
  582.         </rect>
  583.         <style>shadow</style>
  584.         <autoSelect> <false /> </autoSelect>
  585.         <showLines> <false /> </showLines>
  586.         <wideMargins> <false /> </wideMargins>
  587.         <multipleLines> <false /> </multipleLines>
  588.         <reservedFamily> 0 </reservedFamily>
  589.         <titleWidth>0</titleWidth>
  590.         <icon>0</icon>
  591.         <textAlign>left</textAlign>
  592.         <font>Palatino</font>
  593.         <textSize>14</textSize>
  594.         <textStyle>plain</textStyle>
  595.         <textHeight>18</textHeight>
  596.         <name>results</name>
  597.         <script>on mousedown
  598. hide me
  599. end mousedown</script>
  600.     </part>
  601.     <content>
  602.         <layer>card</layer>
  603.         <id>1</id>
  604.         <text>{    Name: GetLocale}
  605. {        This XCMD fetches location information that is stored in the Macintosh's}
  606. {        parameter RAM. This information can be set using the Map cdev}
  607. {        (a part of Apple system software) or by the SetLocale XCMD}
  608. {        that accopanies this XCMD.}
  609. {}
  610. {    Written by : Len Saaf}
  611. {        January, 1991}
  612. {        ┬⌐1991 Raleigh Associates}
  613. {        Free for non-commercial use}
  614. {        Developed with THINK Pascal 3.0, ┬⌐1990 SYMANTEC Corp.}
  615. {}
  616. {    Form: GetLocale}
  617. {        The first word of the result is "Error" if an error has occurred.}
  618. {        Otherwise, the result is a four-item container:}
  619. {            1)    Latitude in degrees (positive for north, negative for south)}
  620. {            2)    Longitude in degrees (positive for east, negative for west)}
  621. {            3)    Difference from UTC (aka GMT) in hours}
  622. {            4)    A daylight savings time difference (undocumented as far as I can tell)}
  623. {}
  624. {    Example: GetLocale}
  625. {        put the result into myLoc}
  626. {        put item 1 of myLoc into myLatitude}
  627. {        put item 2 of myLoc into myLongitude}
  628. {}
  629. {    Note:}
  630. {        Latitude & longitude are returned in decimal form, not in degrees, minutes,}
  631. {        and secondsΓÇölikewise with the UTC difference in hours.}
  632. {}
  633. {    Include the following files in the project:}
  634. {        DRVRRuntime.lib}
  635. {        Interface.lib}
  636. {        SANElib.lib}
  637. {        FixMath.p}
  638. {        Script.p}
  639. {        HyperXCmd.p}
  640. {        HyperXLib.o}
  641. {        GetLocale.p}
  642.  
  643. unit DummyUnit;
  644.  
  645. interface
  646.     uses
  647.         HyperXCmd, FixMath, Script;
  648.  
  649.     procedure Main (paramPtr: XCmdPtr);
  650.  
  651. implementation
  652.  
  653.     procedure Main (paramPtr: XCmdPtr);
  654.         const
  655.             Version = 'GetLocale XCMD 1.0 ┬⌐Raleigh Associates 1991 - Gets location info from PRAM';
  656.             Usage = 'Usage: No arguments. Returns: Latitude, Longitude, UTCdifference, DaylightSavingsDifference';
  657.             MinArgs = 0;
  658.             MaxArgs = 0;
  659.         var
  660.             lat, lon, utcDiff, dlsDiff: real;
  661.  
  662.         procedure CleanUpAndExit;
  663.         begin
  664. { nothing to clean up }
  665.             exit(Main);
  666.         end; { CleanUpAndExit }
  667.  
  668.         procedure Error (paramPtr: XCmdPtr; errStr: str255);
  669.         begin
  670.             errStr := concat('Error from GetLocale : ', errStr);
  671.             paramPtr^.returnValue := PasToZero(paramPtr, errStr);
  672.             CleanUpAndExit;
  673.         end; { Error }
  674.  
  675.         procedure InitProc (paramPtr: XCmdPtr); {  }
  676.             var
  677.                 str: str255;
  678.         begin
  679.             paramPtr^.returnValue := nil;
  680.             paramPtr^.passflag := FALSE;
  681.  
  682.             if paramPtr^.paramCount = 1 then
  683.                 begin
  684.                     ZeroToPas(paramPtr, paramPtr^.params[1]^, str);
  685.                     if (str = '!') or (str = '?') then
  686.                         begin
  687.                             if str = '!' then
  688.                                 paramPtr^.returnValue := PasToZero(paramPtr, Version)
  689.                             else
  690.                                 paramPtr^.returnValue := PasToZero(paramPtr, Usage);
  691.                             CleanUpAndExit;
  692.                         end; { if }
  693.                 end; { if }
  694.  
  695.             if (paramPtr^.paramCount < MinArgs) or (paramPtr^.paramCount > MaxArgs) then
  696.                 Error(paramPtr, concat('Wrong number of arguments. ', Usage));
  697.         end; { InitProc }
  698.  
  699.         procedure ReturnProc (paramPtr: XCmdPtr); { puts the values into returnValue }
  700.             var
  701.                 str1, str2, str3, str4: str255;
  702.         begin
  703.             ExtToStr(paramPtr, lat, str1);
  704.             ExtToStr(paramPtr, lon, str2);
  705.             ExtToStr(paramPtr, utcDiff, str3);
  706.             ExtToStr(paramPtr, dlsDiff, str4);
  707.             str1 := concat(str1, ',', str2, ',', str3, ',', str4);
  708.             if (lat = 0) and (lon = 0) and (utcDiff = 0) then { all are zero if the PRAM is empty or zapped }
  709.                 Error(paramPtr, 'Location information has not been set!')
  710.             else
  711.                 paramPtr^.returnValue := PasToZero(paramPtr, str1);
  712.             CleanUpAndExit;
  713.         end; { ReturnProc }
  714.  
  715.         procedure GetLocale (paramPtr: XCmdPtr);
  716.             var
  717.                 myLocale: MachineLocation;
  718.                 iutcdelta: longint;
  719.                 mybyte: SignedByte;
  720.         begin
  721.             ReadLocation(myLocale); { this is the Script Manager routine that extracts the data from the PRAM }
  722.             lat := Frac2X(myLocale.latitude) * 90;
  723.             lon := Frac2X(myLocale.longitude) * 90;
  724.             iutcdelta := BAnd(myLocale.gmtDelta, $00FFFFFF);
  725.             if BTst(iutcdelta, 23) then
  726.                 iutcdelta := BOr(iutcdelta, $FF000000);
  727.             utcDiff := iutcdelta / 3600;
  728.             mybyte := myLocale.dlsDelta;
  729.             dlsDiff := mybyte;
  730.         end; { GetLocale }
  731.  
  732.     begin { Main }
  733.         InitProc(paramPtr);
  734.         GetLocale(paramPtr);
  735.         ReturnProc(paramPtr);
  736.     end; { Main }
  737.  
  738. end. { implementation }</text>
  739.     </content>
  740.     <content>
  741.         <layer>card</layer>
  742.         <id>2</id>
  743.         <text><span class="style5">etLocale XCMD</span><span class="style1">
  744. This XCMD fetches location information stored in the Macintosh's parameter RAM. This information can be set using the Map cdev    (a part of Apple system software) or by the SetLocale XCMD included in this stack.
  745. </span><span class="style6">
  746. </span><span class="style1">Form: </span><span class="style11">GetLocale</span><span class="style1">
  747. The first word of the result is "Error" if an error has occurred.
  748. Otherwise, the result is a four-item container:
  749.   1)    Latitude in degrees (positive for north, negative for south)
  750.      2)    Longitude in degrees (positive for east, negative for west)
  751.      3)    Difference from UTC (aka GMT) in hours
  752.      4)    A daylight savings time difference (undocumented as far
  753.       as I can tell)
  754.  
  755. Example: </span><span class="style11">GetLocale
  756. put the result into myLoc
  757. put item 1 of myLoc into myLatitude
  758. put item 2 of myLoc into myLongitude</span><span class="style1">
  759. </span></text>
  760.     </content>
  761.     <content>
  762.         <layer>card</layer>
  763.         <id>3</id>
  764.         <text>Notes:
  765.     Latitude & longitude are returned in decimal form, not in degrees, minutes,    and secondsΓÇölikewise with the UTC difference in hours.
  766.  
  767. If the location has never been set, or if the PRAM has been zapped, the XCMD returns an error.</text>
  768.     </content>
  769.     <content>
  770.         <layer>card</layer>
  771.         <id>9</id>
  772.         <text>
  773. XCMD returned: 43.25,-77.5,-5,0
  774.  
  775. Latitude: 43.25 North
  776. Longitude: 77.5 West
  777.  
  778. 5 hours behind UTC
  779.  
  780. Click to hide.</text>
  781.     </content>
  782.     <name>getlocale</name>
  783.     <script></script>
  784. </card>
  785.  
  786.  
  787. card_4422.xml
  788. <?xml version="1.0" encoding="utf-8" ?>
  789. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  790. <card>
  791.     <id>4422</id>
  792.     <filler1>0</filler1>
  793.     <bitmap>BMAP_4842.pbm</bitmap>
  794.     <cantDelete> <false /> </cantDelete>
  795.     <showPict> <true /> </showPict>
  796.     <dontSearch> <false /> </dontSearch>
  797.     <owner>2566</owner>
  798.     <link rel="stylesheet" type="text/css" href="stylesheet_3211.css" />
  799.     <part>
  800.         <id>2</id>
  801.         <type>field</type>
  802.         <visible> <true /> </visible>
  803.         <dontWrap> <false /> </dontWrap>
  804.         <dontSearch> <false /> </dontSearch>
  805.         <sharedText> <false /> </sharedText>
  806.         <fixedLineHeight> <false /> </fixedLineHeight>
  807.         <autoTab> <false /> </autoTab>
  808.         <lockText> <true /> </lockText>
  809.         <rect>
  810.             <left>5</left>
  811.             <top>24</top>
  812.             <right>508</right>
  813.             <bottom>304</bottom>
  814.         </rect>
  815.         <style>transparent</style>
  816.         <autoSelect> <false /> </autoSelect>
  817.         <showLines> <false /> </showLines>
  818.         <wideMargins> <false /> </wideMargins>
  819.         <multipleLines> <false /> </multipleLines>
  820.         <reservedFamily> 0 </reservedFamily>
  821.         <titleWidth>0</titleWidth>
  822.         <icon>0</icon>
  823.         <textAlign>left</textAlign>
  824.         <font>Palatino</font>
  825.         <textSize>12</textSize>
  826.         <textStyle>plain</textStyle>
  827.         <textHeight>16</textHeight>
  828.         <name></name>
  829.         <script></script>
  830.     </part>
  831.     <part>
  832.         <id>3</id>
  833.         <type>field</type>
  834.         <visible> <true /> </visible>
  835.         <dontWrap> <false /> </dontWrap>
  836.         <dontSearch> <false /> </dontSearch>
  837.         <sharedText> <false /> </sharedText>
  838.         <fixedLineHeight> <false /> </fixedLineHeight>
  839.         <autoTab> <false /> </autoTab>
  840.         <lockText> <true /> </lockText>
  841.         <rect>
  842.             <left>363</left>
  843.             <top>166</top>
  844.             <right>496</right>
  845.             <bottom>285</bottom>
  846.         </rect>
  847.         <style>shadow</style>
  848.         <autoSelect> <false /> </autoSelect>
  849.         <showLines> <false /> </showLines>
  850.         <wideMargins> <false /> </wideMargins>
  851.         <multipleLines> <false /> </multipleLines>
  852.         <reservedFamily> 0 </reservedFamily>
  853.         <titleWidth>0</titleWidth>
  854.         <icon>0</icon>
  855.         <textAlign>left</textAlign>
  856.         <font>Geneva</font>
  857.         <textSize>12</textSize>
  858.         <textStyle>plain</textStyle>
  859.         <textHeight>16</textHeight>
  860.         <name></name>
  861.         <script></script>
  862.     </part>
  863.     <part>
  864.         <id>4</id>
  865.         <type>button</type>
  866.         <visible> <true /> </visible>
  867.         <reserved5> 0 </reserved5>
  868.         <reserved4> 0 </reserved4>
  869.         <reserved3> 0 </reserved3>
  870.         <reserved2> 0 </reserved2>
  871.         <reserved1> 0 </reserved1>
  872.         <enabled> <true /> </enabled>
  873.         <rect>
  874.             <left>42</left>
  875.             <top>306</top>
  876.             <right>145</right>
  877.             <bottom>329</bottom>
  878.         </rect>
  879.         <style>transparent</style>
  880.         <showName> <false /> </showName>
  881.         <highlight> <false /> </highlight>
  882.         <autoHighlight> <true /> </autoHighlight>
  883.         <sharedHighlight> <true /> </sharedHighlight>
  884.         <family>0</family>
  885.         <titleWidth>0</titleWidth>
  886.         <icon>0</icon>
  887.         <textAlign>center</textAlign>
  888.         <font>Chicago</font>
  889.         <textSize>12</textSize>
  890.         <textStyle>plain</textStyle>
  891.         <name></name>
  892.         <script>on mouseUp
  893. ask "Enter your latitude: (negative for south)"
  894. if the result is "Cancel" then exit mouseUp
  895. put it into lat
  896. ask "Enter your longitude: (negative for west)"
  897. if the result is "Cancel" then exit mouseup
  898. put it into lon
  899. ask "Enter your time zone difference from UTC: (-5 for EST)"
  900. if the result is "Cancel" then exit mouseup
  901. put it into tz
  902. SetLocale lat,lon,tz
  903. put the result into myres
  904. if word 1 of myres is "Error" then
  905. beep
  906. answer myres
  907. else
  908. answer "Done!"
  909. end if
  910. end mouseUp</script>
  911.     </part>
  912.     <part>
  913.         <id>5</id>
  914.         <type>button</type>
  915.         <visible> <true /> </visible>
  916.         <reserved5> 0 </reserved5>
  917.         <reserved4> 0 </reserved4>
  918.         <reserved3> 0 </reserved3>
  919.         <reserved2> 0 </reserved2>
  920.         <reserved1> 0 </reserved1>
  921.         <enabled> <true /> </enabled>
  922.         <rect>
  923.             <left>170</left>
  924.             <top>306</top>
  925.             <right>273</right>
  926.             <bottom>329</bottom>
  927.         </rect>
  928.         <style>transparent</style>
  929.         <showName> <false /> </showName>
  930.         <highlight> <false /> </highlight>
  931.         <autoHighlight> <true /> </autoHighlight>
  932.         <sharedHighlight> <true /> </sharedHighlight>
  933.         <family>0</family>
  934.         <titleWidth>0</titleWidth>
  935.         <icon>0</icon>
  936.         <textAlign>center</textAlign>
  937.         <font>Chicago</font>
  938.         <textSize>12</textSize>
  939.         <textStyle>plain</textStyle>
  940.         <name></name>
  941.         <script>on mouseUp
  942. set the scroll of cd fld "source" to 0
  943. show cd fld "source"
  944. end mouseUp</script>
  945.     </part>
  946.     <part>
  947.         <id>6</id>
  948.         <type>button</type>
  949.         <visible> <true /> </visible>
  950.         <reserved5> 0 </reserved5>
  951.         <reserved4> 0 </reserved4>
  952.         <reserved3> 0 </reserved3>
  953.         <reserved2> 0 </reserved2>
  954.         <reserved1> 0 </reserved1>
  955.         <enabled> <true /> </enabled>
  956.         <rect>
  957.             <left>365</left>
  958.             <top>313</top>
  959.             <right>388</right>
  960.             <bottom>335</bottom>
  961.         </rect>
  962.         <style>transparent</style>
  963.         <showName> <false /> </showName>
  964.         <highlight> <false /> </highlight>
  965.         <autoHighlight> <true /> </autoHighlight>
  966.         <sharedHighlight> <true /> </sharedHighlight>
  967.         <family>0</family>
  968.         <titleWidth>0</titleWidth>
  969.         <icon>1014</icon>
  970.         <textAlign>center</textAlign>
  971.         <font>Chicago</font>
  972.         <textSize>12</textSize>
  973.         <textStyle>plain</textStyle>
  974.         <name></name>
  975.         <script>on mouseUp
  976. visual wipe right
  977. go prev cd
  978. end mouseUp</script>
  979.     </part>
  980.     <part>
  981.         <id>7</id>
  982.         <type>button</type>
  983.         <visible> <true /> </visible>
  984.         <reserved5> 0 </reserved5>
  985.         <reserved4> 0 </reserved4>
  986.         <reserved3> 0 </reserved3>
  987.         <reserved2> 0 </reserved2>
  988.         <reserved1> 0 </reserved1>
  989.         <enabled> <true /> </enabled>
  990.         <rect>
  991.             <left>396</left>
  992.             <top>313</top>
  993.             <right>419</right>
  994.             <bottom>335</bottom>
  995.         </rect>
  996.         <style>transparent</style>
  997.         <showName> <false /> </showName>
  998.         <highlight> <false /> </highlight>
  999.         <autoHighlight> <true /> </autoHighlight>
  1000.         <sharedHighlight> <true /> </sharedHighlight>
  1001.         <family>0</family>
  1002.         <titleWidth>0</titleWidth>
  1003.         <icon>1013</icon>
  1004.         <textAlign>center</textAlign>
  1005.         <font>Chicago</font>
  1006.         <textSize>12</textSize>
  1007.         <textStyle>plain</textStyle>
  1008.         <name></name>
  1009.         <script>on mouseUp
  1010. visual wipe left
  1011. go next cd
  1012. end mouseUp
  1013. </script>
  1014.     </part>
  1015.     <part>
  1016.         <id>8</id>
  1017.         <type>button</type>
  1018.         <visible> <true /> </visible>
  1019.         <reserved5> 0 </reserved5>
  1020.         <reserved4> 0 </reserved4>
  1021.         <reserved3> 0 </reserved3>
  1022.         <reserved2> 0 </reserved2>
  1023.         <reserved1> 0 </reserved1>
  1024.         <enabled> <true /> </enabled>
  1025.         <rect>
  1026.             <left>435</left>
  1027.             <top>313</top>
  1028.             <right>458</right>
  1029.             <bottom>335</bottom>
  1030.         </rect>
  1031.         <style>transparent</style>
  1032.         <showName> <false /> </showName>
  1033.         <highlight> <false /> </highlight>
  1034.         <autoHighlight> <true /> </autoHighlight>
  1035.         <sharedHighlight> <true /> </sharedHighlight>
  1036.         <family>0</family>
  1037.         <titleWidth>0</titleWidth>
  1038.         <icon>1012</icon>
  1039.         <textAlign>center</textAlign>
  1040.         <font>Chicago</font>
  1041.         <textSize>12</textSize>
  1042.         <textStyle>plain</textStyle>
  1043.         <name></name>
  1044.         <script>on mouseUp
  1045. visual iris close
  1046. go first cd
  1047. end mouseUp</script>
  1048.     </part>
  1049.     <part>
  1050.         <id>1</id>
  1051.         <type>field</type>
  1052.         <visible> <false /> </visible>
  1053.         <dontWrap> <false /> </dontWrap>
  1054.         <dontSearch> <false /> </dontSearch>
  1055.         <sharedText> <false /> </sharedText>
  1056.         <fixedLineHeight> <false /> </fixedLineHeight>
  1057.         <autoTab> <false /> </autoTab>
  1058.         <lockText> <true /> </lockText>
  1059.         <rect>
  1060.             <left>6</left>
  1061.             <top>26</top>
  1062.             <right>504</right>
  1063.             <bottom>334</bottom>
  1064.         </rect>
  1065.         <style>scrolling</style>
  1066.         <autoSelect> <false /> </autoSelect>
  1067.         <showLines> <false /> </showLines>
  1068.         <wideMargins> <false /> </wideMargins>
  1069.         <multipleLines> <false /> </multipleLines>
  1070.         <reservedFamily> 0 </reservedFamily>
  1071.         <titleWidth>0</titleWidth>
  1072.         <icon>0</icon>
  1073.         <textAlign>left</textAlign>
  1074.         <font>Geneva</font>
  1075.         <textSize>9</textSize>
  1076.         <textStyle>plain</textStyle>
  1077.         <textHeight>12</textHeight>
  1078.         <name>source</name>
  1079.         <script>on mousedown
  1080. hide me
  1081. end mousedown</script>
  1082.     </part>
  1083.     <content>
  1084.         <layer>card</layer>
  1085.         <id>1</id>
  1086.         <text>{    Name: SetLocale}
  1087. {        This XCMD set location information that is stored in the Macintosh's}
  1088. {        parameter RAM. This information is normally set using the Map cdev}
  1089. {        (a part of Apple system software). The location information can be}
  1090. {        read with the GetLocale XCMD that accompanies this XCMD.}
  1091. {}
  1092. {    By : Len Saaf}
  1093. {        January, 1991}
  1094. {        ┬⌐1991 Raleigh Associates}
  1095. {        Free for non-commercial use}
  1096. {        Developed with THINK Pascal 3.0, ┬⌐1990 SYMANTEC Corp.}
  1097. {}
  1098. {    Form: SetLocale latitude,longitude,UTCdifference,DSTdifference}
  1099. {        The first word of the result is "Error" if an error has occurred.}
  1100. {            1)    Latitude is in degrees (positive for north, negative for south)}
  1101. {            2)    Longitude is in degrees (positive for east, negative for west)}
  1102. {            3)    Difference from UTC (aka GMT) in hours}
  1103. {            4)    A daylight savings time difference (undocumented as far as I can tell)}
  1104. {}
  1105. {    Example: SetLocale 43.25, -77.5, -5, 0}
  1106. {        This sets the location to 43.25┬░ N, 77.5┬░ W}
  1107. {        The UTC difference is set to -5 (EST)}
  1108. {}
  1109. {    Note:}
  1110. {        Latitude & longitude should be in decimal form, not in degrees, minutes,}
  1111. {        and secondsΓÇölikewise with the UTC difference in hours.}
  1112. {}
  1113. {    Include the following files in the project:}
  1114. {        DRVRRuntime.lib}
  1115. {        Interface.lib}
  1116. {        SANE.p}
  1117. {        SANElib.lib}
  1118. {        FixMath.p}
  1119. {        Script.p}
  1120. {        HyperXCmd.p}
  1121. {        HyperXLib.o}
  1122. {        SetLocale.p}
  1123.  
  1124. unit DummyUnit;
  1125.  
  1126. interface
  1127.     uses
  1128.         HyperXCmd, FixMath, Script, SANE;
  1129.  
  1130.     procedure Main (paramPtr: XCmdPtr);
  1131.  
  1132. implementation
  1133.  
  1134.     procedure Main (paramPtr: XCmdPtr);
  1135.         const
  1136.             Version = 'SetLocale XCMD 1.0 ┬⌐Raleigh Associates 1991 - Sets location info in PRAM';
  1137.             Usage = 'Usage: SetLocale latitude, longitude, <UTCdifference, <DSTdifference>>';
  1138.             MinArgs = 2;
  1139.             MaxArgs = 4;
  1140.  
  1141.         procedure CleanUpAndExit;
  1142.         begin
  1143. { nothing to clean up }
  1144.             exit(Main);
  1145.         end; { CleanUpAndExit }
  1146.  
  1147.         procedure Error (paramPtr: XCmdPtr; errStr: str255);
  1148.         begin
  1149.             errStr := concat('Error from SetLocale : ', errStr);
  1150.             paramPtr^.returnValue := PasToZero(paramPtr, errStr);
  1151.             CleanUpAndExit;
  1152.         end; { Error }
  1153.  
  1154.         function ReadReal (paramPtr: XCmdPtr; paramNo: integer; var myReal: real): Boolean;
  1155. { Reads in a specified parameter and validates it using SANE routines }
  1156.             const
  1157.                 maxreal = 3.4e38;
  1158.             var
  1159.                 d: Decimal;
  1160.                 validPrefix: Boolean;
  1161.                 index: integer;
  1162.                 myExt: extended;
  1163.         begin
  1164.             if (paramNo > paramPtr^.paramCount) or (paramNo < 1) then
  1165.                 ReadReal := False
  1166.             else
  1167.                 begin
  1168.                     index := 0;
  1169.                     CStr2Dec(CStrPtr(paramPtr^.params[paramNo]^), index, d, validPrefix);
  1170.                     if not validPrefix then
  1171.                         ReadReal := False
  1172.                     else
  1173.                         begin
  1174.                             myExt := Dec2Num(d);
  1175.                             case ClassExtended(myExt) of
  1176.                                 ZeroNum, NormalNum: 
  1177.                                     if (abs(myExt) < maxreal) then
  1178.                                         begin
  1179.                                             myReal := myExt;
  1180.                                             ReadReal := True;
  1181.                                         end
  1182.                                     else
  1183.                                         ReadReal := False;
  1184.                                 otherwise
  1185.                                     ReadReal := False;
  1186.                             end; { case }
  1187.                         end; { if }
  1188.                 end; { if }
  1189.         end; { ReadReal }
  1190.  
  1191.         procedure InitProc (paramPtr: XCmdPtr); {  }
  1192.             var
  1193.                 str: str255;
  1194.         begin
  1195.             paramPtr^.returnValue := nil;
  1196.             paramPtr^.passflag := FALSE;
  1197.  
  1198.             if paramPtr^.paramCount = 1 then
  1199.                 begin
  1200.                     ZeroToPas(paramPtr, paramPtr^.params[1]^, str);
  1201.                     if (str = '!') or (str = '?') then
  1202.                         begin
  1203.                             if str = '!' then
  1204.                                 paramPtr^.returnValue := PasToZero(paramPtr, Version)
  1205.                             else
  1206.                                 paramPtr^.returnValue := PasToZero(paramPtr, Usage);
  1207.                             CleanUpAndExit;
  1208.                         end; { if }
  1209.                 end; { if }
  1210.  
  1211.             if (paramPtr^.paramCount < MinArgs) or (paramPtr^.paramCount > MaxArgs) then
  1212.                 Error(paramPtr, concat('Wrong number of arguments. ', Usage));
  1213.         end; { InitProc }
  1214.  
  1215.         procedure ReturnProc (paramPtr: XCmdPtr); { puts the values into returnValue }
  1216.         begin
  1217. { Nothing to return }
  1218.             CleanUpAndExit;
  1219.         end; { ReturnProc }
  1220.  
  1221.         procedure SetLocale (paramPtr: XCmdPtr);
  1222.             var
  1223.                 lat, lon, utcDiff, dlsDiff: real;
  1224.                 myLocale: MachineLocation;
  1225.                 tUTC: longint;
  1226.                 tDLS: SignedByte;
  1227.                 str: str255;
  1228.                 pCount: integer;
  1229.         begin
  1230. { read and check the arguments }
  1231.             pCount := paramPtr^.paramCount;
  1232.  
  1233.             if ReadReal(paramPtr, 1, lat) then
  1234.                 if (lat >= -90) and (lat <= 90) then
  1235.                 else
  1236.                     Error(paramPtr, 'Latitude out of range')
  1237.             else
  1238.                 Error(paramPtr, 'Invalid latitude');
  1239.  
  1240.             if pCount >= 2 then
  1241.                 begin
  1242.                     if ReadReal(paramPtr, 2, lon) then
  1243.                         if (lon >= -180) and (lon <= 180) then
  1244.                         else
  1245.                             Error(paramPtr, 'Longitude out of range')
  1246.                     else
  1247.                         Error(paramPtr, 'Invalid longitude');
  1248.                 end; { if }
  1249.  
  1250.             if pCount >= 3 then
  1251.                 begin
  1252.                     if ReadReal(paramPtr, 3, utcDiff) then
  1253.                         if (utcDiff > -24) and (utcDiff < 24) then
  1254.                         else
  1255.                             Error(paramPtr, 'UTC difference out of range')
  1256.                     else
  1257.                         Error(paramPtr, 'Invalid UTC difference');
  1258.                 end; { if }
  1259.  
  1260.             if pCount = 4 then
  1261.                 begin
  1262.                     if ReadReal(paramPtr, 4, dlsDiff) then
  1263.                         if (dlsDiff >= -127) and (dlsDiff < 128) then
  1264.                         else
  1265.                             Error(paramPtr, 'DLS difference out of range')
  1266.                     else
  1267.                         Error(paramPtr, 'Invalid DLS difference');
  1268.                 end; { if }
  1269.  
  1270.             ReadLocation(myLocale); { Script Manager routine to get the info from PRAM }
  1271.             myLocale.latitude := X2Frac(lat / 90);
  1272.             myLocale.longitude := X2Frac(lon / 90);
  1273.             if paramPtr^.paramCount >= 3 then
  1274.                 begin
  1275.                     tDLS := myLocale.dlsDelta;
  1276.                     tUTC := round(utcDiff * 3600);
  1277.                     if pCount >= 4 then
  1278.                         tDLS := round(dlsDiff);
  1279.                     myLocale.gmtDelta := tUTC;
  1280.                     myLocale.dlsDelta := tDLS;
  1281.                 end; { if }
  1282.             WriteLocation(myLocale); { Script Manager routine to write the info to PRAM }
  1283.         end; { SetLocale }
  1284.  
  1285.     begin { Main }
  1286.         InitProc(paramPtr);
  1287.         SetLocale(paramPtr);
  1288.         ReturnProc(paramPtr);
  1289.     end; { Main }
  1290.  
  1291. end. { implementation }</text>
  1292.     </content>
  1293.     <content>
  1294.         <layer>card</layer>
  1295.         <id>2</id>
  1296.         <text><span class="style5">etLocale XCMD</span><span class="style1">
  1297. This XCMD sets the location information that is stored in the Macintosh's parameter RAM. This information is normally set using the Map cdev (a part of Apple system software). The location information can be read with the GetLocale XCMD included in this stack. 
  1298.  
  1299. Form: </span><span class="style11">SetLocale latitude,longitude<,UTCdifference<,DSTdifference>></span><span class="style1">
  1300. The last two arguments are optional. The arguments in detail:
  1301.   1)    Latitude in degrees (positive for north, negative for south)
  1302.   2)    Longitude in degrees (positive for east, negative for west)
  1303.   3)    Difference from UTC (aka GMT) in hours
  1304.   4)    A daylight savings time difference (undocumented
  1305.       as far as I can tell)
  1306. If the first word of the result is "Error" if an error has occurred.
  1307.  
  1308. Example: </span><span class="style11">SetLocale 43.25,-77.5,-5</span><span class="style1">
  1309. This sets the location to 43.25┬░ N, 77.5┬░ W
  1310. The UTC difference is set to -5 (EST)
  1311.  
  1312. </span></text>
  1313.     </content>
  1314.     <content>
  1315.         <layer>card</layer>
  1316.         <id>3</id>
  1317.         <text><span class="style3">ote:
  1318. Latitude & longitude should be in decimal form, not in degrees, minutes, and secondsΓÇölikewise with the UTC difference in hours.</span></text>
  1319.     </content>
  1320.     <name>setlocale</name>
  1321.     <script></script>
  1322. </card>
  1323.  
  1324.  
  1325. card_5034.xml
  1326. <?xml version="1.0" encoding="utf-8" ?>
  1327. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  1328. <card>
  1329.     <id>5034</id>
  1330.     <filler1>0</filler1>
  1331.     <bitmap>BMAP_5240.pbm</bitmap>
  1332.     <cantDelete> <false /> </cantDelete>
  1333.     <showPict> <true /> </showPict>
  1334.     <dontSearch> <false /> </dontSearch>
  1335.     <owner>2566</owner>
  1336.     <link rel="stylesheet" type="text/css" href="stylesheet_3211.css" />
  1337.     <part>
  1338.         <id>2</id>
  1339.         <type>field</type>
  1340.         <visible> <true /> </visible>
  1341.         <dontWrap> <false /> </dontWrap>
  1342.         <dontSearch> <false /> </dontSearch>
  1343.         <sharedText> <false /> </sharedText>
  1344.         <fixedLineHeight> <false /> </fixedLineHeight>
  1345.         <autoTab> <false /> </autoTab>
  1346.         <lockText> <true /> </lockText>
  1347.         <rect>
  1348.             <left>5</left>
  1349.             <top>24</top>
  1350.             <right>508</right>
  1351.             <bottom>304</bottom>
  1352.         </rect>
  1353.         <style>transparent</style>
  1354.         <autoSelect> <false /> </autoSelect>
  1355.         <showLines> <false /> </showLines>
  1356.         <wideMargins> <false /> </wideMargins>
  1357.         <multipleLines> <false /> </multipleLines>
  1358.         <reservedFamily> 0 </reservedFamily>
  1359.         <titleWidth>0</titleWidth>
  1360.         <icon>0</icon>
  1361.         <textAlign>left</textAlign>
  1362.         <font>Palatino</font>
  1363.         <textSize>12</textSize>
  1364.         <textStyle>plain</textStyle>
  1365.         <textHeight>16</textHeight>
  1366.         <name></name>
  1367.         <script></script>
  1368.     </part>
  1369.     <part>
  1370.         <id>3</id>
  1371.         <type>field</type>
  1372.         <visible> <true /> </visible>
  1373.         <dontWrap> <false /> </dontWrap>
  1374.         <dontSearch> <false /> </dontSearch>
  1375.         <sharedText> <false /> </sharedText>
  1376.         <fixedLineHeight> <false /> </fixedLineHeight>
  1377.         <autoTab> <false /> </autoTab>
  1378.         <lockText> <true /> </lockText>
  1379.         <rect>
  1380.             <left>261</left>
  1381.             <top>217</top>
  1382.             <right>497</right>
  1383.             <bottom>281</bottom>
  1384.         </rect>
  1385.         <style>shadow</style>
  1386.         <autoSelect> <false /> </autoSelect>
  1387.         <showLines> <false /> </showLines>
  1388.         <wideMargins> <false /> </wideMargins>
  1389.         <multipleLines> <false /> </multipleLines>
  1390.         <reservedFamily> 0 </reservedFamily>
  1391.         <titleWidth>0</titleWidth>
  1392.         <icon>0</icon>
  1393.         <textAlign>left</textAlign>
  1394.         <font>Geneva</font>
  1395.         <textSize>12</textSize>
  1396.         <textStyle>plain</textStyle>
  1397.         <textHeight>16</textHeight>
  1398.         <name></name>
  1399.         <script></script>
  1400.     </part>
  1401.     <part>
  1402.         <id>4</id>
  1403.         <type>button</type>
  1404.         <visible> <true /> </visible>
  1405.         <reserved5> 0 </reserved5>
  1406.         <reserved4> 0 </reserved4>
  1407.         <reserved3> 0 </reserved3>
  1408.         <reserved2> 0 </reserved2>
  1409.         <reserved1> 0 </reserved1>
  1410.         <enabled> <true /> </enabled>
  1411.         <rect>
  1412.             <left>42</left>
  1413.             <top>306</top>
  1414.             <right>145</right>
  1415.             <bottom>329</bottom>
  1416.         </rect>
  1417.         <style>transparent</style>
  1418.         <showName> <false /> </showName>
  1419.         <highlight> <false /> </highlight>
  1420.         <autoHighlight> <true /> </autoHighlight>
  1421.         <sharedHighlight> <true /> </sharedHighlight>
  1422.         <family>0</family>
  1423.         <titleWidth>0</titleWidth>
  1424.         <icon>0</icon>
  1425.         <textAlign>center</textAlign>
  1426.         <font>Chicago</font>
  1427.         <textSize>12</textSize>
  1428.         <textStyle>plain</textStyle>
  1429.         <name></name>
  1430.         <script>on mouseUp
  1431. --answer "This demo will not report errorsΓÇöyou're on your own."
  1432. ask "Enter all the arguments you want to use. (e.g. 15,0,0,,,1984)"
  1433. if the result is "Cancel" then exit mouseup
  1434. put it into args
  1435. --domenu "message"
  1436. put the blindtyping into myblind
  1437. set the blindtyping to true
  1438. type "SetTimeDate" && args & return
  1439. put the result into myres
  1440. set the blindtyping to myblind
  1441. updatetime
  1442. if word 1 of myres is "Error" then
  1443. beep
  1444. answer myres
  1445. else
  1446. answer "Done!"
  1447. end if
  1448. end mouseUp</script>
  1449.     </part>
  1450.     <part>
  1451.         <id>5</id>
  1452.         <type>button</type>
  1453.         <visible> <true /> </visible>
  1454.         <reserved5> 0 </reserved5>
  1455.         <reserved4> 0 </reserved4>
  1456.         <reserved3> 0 </reserved3>
  1457.         <reserved2> 0 </reserved2>
  1458.         <reserved1> 0 </reserved1>
  1459.         <enabled> <true /> </enabled>
  1460.         <rect>
  1461.             <left>170</left>
  1462.             <top>306</top>
  1463.             <right>273</right>
  1464.             <bottom>329</bottom>
  1465.         </rect>
  1466.         <style>transparent</style>
  1467.         <showName> <false /> </showName>
  1468.         <highlight> <false /> </highlight>
  1469.         <autoHighlight> <true /> </autoHighlight>
  1470.         <sharedHighlight> <true /> </sharedHighlight>
  1471.         <family>0</family>
  1472.         <titleWidth>0</titleWidth>
  1473.         <icon>0</icon>
  1474.         <textAlign>center</textAlign>
  1475.         <font>Chicago</font>
  1476.         <textSize>12</textSize>
  1477.         <textStyle>plain</textStyle>
  1478.         <name></name>
  1479.         <script>on mouseUp
  1480. set the scroll of cd fld "source" to 0
  1481. show cd fld "source"
  1482. end mouseUp</script>
  1483.     </part>
  1484.     <part>
  1485.         <id>6</id>
  1486.         <type>button</type>
  1487.         <visible> <true /> </visible>
  1488.         <reserved5> 0 </reserved5>
  1489.         <reserved4> 0 </reserved4>
  1490.         <reserved3> 0 </reserved3>
  1491.         <reserved2> 0 </reserved2>
  1492.         <reserved1> 0 </reserved1>
  1493.         <enabled> <true /> </enabled>
  1494.         <rect>
  1495.             <left>365</left>
  1496.             <top>313</top>
  1497.             <right>388</right>
  1498.             <bottom>335</bottom>
  1499.         </rect>
  1500.         <style>transparent</style>
  1501.         <showName> <false /> </showName>
  1502.         <highlight> <false /> </highlight>
  1503.         <autoHighlight> <true /> </autoHighlight>
  1504.         <sharedHighlight> <true /> </sharedHighlight>
  1505.         <family>0</family>
  1506.         <titleWidth>0</titleWidth>
  1507.         <icon>1014</icon>
  1508.         <textAlign>center</textAlign>
  1509.         <font>Chicago</font>
  1510.         <textSize>12</textSize>
  1511.         <textStyle>plain</textStyle>
  1512.         <name></name>
  1513.         <script>on mouseUp
  1514. visual wipe right
  1515. go prev cd
  1516. end mouseUp</script>
  1517.     </part>
  1518.     <part>
  1519.         <id>7</id>
  1520.         <type>button</type>
  1521.         <visible> <true /> </visible>
  1522.         <reserved5> 0 </reserved5>
  1523.         <reserved4> 0 </reserved4>
  1524.         <reserved3> 0 </reserved3>
  1525.         <reserved2> 0 </reserved2>
  1526.         <reserved1> 0 </reserved1>
  1527.         <enabled> <true /> </enabled>
  1528.         <rect>
  1529.             <left>396</left>
  1530.             <top>313</top>
  1531.             <right>419</right>
  1532.             <bottom>335</bottom>
  1533.         </rect>
  1534.         <style>transparent</style>
  1535.         <showName> <false /> </showName>
  1536.         <highlight> <false /> </highlight>
  1537.         <autoHighlight> <true /> </autoHighlight>
  1538.         <sharedHighlight> <true /> </sharedHighlight>
  1539.         <family>0</family>
  1540.         <titleWidth>0</titleWidth>
  1541.         <icon>1013</icon>
  1542.         <textAlign>center</textAlign>
  1543.         <font>Chicago</font>
  1544.         <textSize>12</textSize>
  1545.         <textStyle>plain</textStyle>
  1546.         <name></name>
  1547.         <script>on mouseUp
  1548. visual wipe left
  1549. go next cd
  1550. end mouseUp
  1551. </script>
  1552.     </part>
  1553.     <part>
  1554.         <id>8</id>
  1555.         <type>button</type>
  1556.         <visible> <true /> </visible>
  1557.         <reserved5> 0 </reserved5>
  1558.         <reserved4> 0 </reserved4>
  1559.         <reserved3> 0 </reserved3>
  1560.         <reserved2> 0 </reserved2>
  1561.         <reserved1> 0 </reserved1>
  1562.         <enabled> <true /> </enabled>
  1563.         <rect>
  1564.             <left>435</left>
  1565.             <top>313</top>
  1566.             <right>458</right>
  1567.             <bottom>335</bottom>
  1568.         </rect>
  1569.         <style>transparent</style>
  1570.         <showName> <false /> </showName>
  1571.         <highlight> <false /> </highlight>
  1572.         <autoHighlight> <true /> </autoHighlight>
  1573.         <sharedHighlight> <true /> </sharedHighlight>
  1574.         <family>0</family>
  1575.         <titleWidth>0</titleWidth>
  1576.         <icon>1012</icon>
  1577.         <textAlign>center</textAlign>
  1578.         <font>Chicago</font>
  1579.         <textSize>12</textSize>
  1580.         <textStyle>plain</textStyle>
  1581.         <name></name>
  1582.         <script>on mouseUp
  1583. visual iris close
  1584. go first cd
  1585. end mouseUp</script>
  1586.     </part>
  1587.     <part>
  1588.         <id>9</id>
  1589.         <type>field</type>
  1590.         <visible> <true /> </visible>
  1591.         <dontWrap> <false /> </dontWrap>
  1592.         <dontSearch> <false /> </dontSearch>
  1593.         <sharedText> <false /> </sharedText>
  1594.         <fixedLineHeight> <false /> </fixedLineHeight>
  1595.         <autoTab> <false /> </autoTab>
  1596.         <lockText> <true /> </lockText>
  1597.         <rect>
  1598.             <left>14</left>
  1599.             <top>239</top>
  1600.             <right>217</right>
  1601.             <bottom>275</bottom>
  1602.         </rect>
  1603.         <style>shadow</style>
  1604.         <autoSelect> <false /> </autoSelect>
  1605.         <showLines> <false /> </showLines>
  1606.         <wideMargins> <false /> </wideMargins>
  1607.         <multipleLines> <false /> </multipleLines>
  1608.         <reservedFamily> 0 </reservedFamily>
  1609.         <titleWidth>0</titleWidth>
  1610.         <icon>0</icon>
  1611.         <textAlign>center</textAlign>
  1612.         <font>Palatino</font>
  1613.         <textSize>14</textSize>
  1614.         <textStyle>plain</textStyle>
  1615.         <textHeight>18</textHeight>
  1616.         <name>clock</name>
  1617.         <script></script>
  1618.     </part>
  1619.     <part>
  1620.         <id>1</id>
  1621.         <type>field</type>
  1622.         <visible> <false /> </visible>
  1623.         <dontWrap> <false /> </dontWrap>
  1624.         <dontSearch> <false /> </dontSearch>
  1625.         <sharedText> <false /> </sharedText>
  1626.         <fixedLineHeight> <false /> </fixedLineHeight>
  1627.         <autoTab> <false /> </autoTab>
  1628.         <lockText> <true /> </lockText>
  1629.         <rect>
  1630.             <left>6</left>
  1631.             <top>26</top>
  1632.             <right>504</right>
  1633.             <bottom>334</bottom>
  1634.         </rect>
  1635.         <style>scrolling</style>
  1636.         <autoSelect> <false /> </autoSelect>
  1637.         <showLines> <false /> </showLines>
  1638.         <wideMargins> <false /> </wideMargins>
  1639.         <multipleLines> <false /> </multipleLines>
  1640.         <reservedFamily> 0 </reservedFamily>
  1641.         <titleWidth>0</titleWidth>
  1642.         <icon>0</icon>
  1643.         <textAlign>left</textAlign>
  1644.         <font>Geneva</font>
  1645.         <textSize>9</textSize>
  1646.         <textStyle>plain</textStyle>
  1647.         <textHeight>12</textHeight>
  1648.         <name>source</name>
  1649.         <script>on mousedown
  1650. hide me
  1651. end mousedown</script>
  1652.     </part>
  1653.     <content>
  1654.         <layer>card</layer>
  1655.         <id>2</id>
  1656.         <text><span class="style5">etTimeDate XCMD</span><span class="style1">
  1657. This XCMD set the date and time of the Macintosh's clock. It is analagous to the ToolBox routine, SetDateTime.
  1658.  
  1659. Form:
  1660. </span><span class="style11">SetTimeDate hour,minute,second,month,day,year</span><span class="style1"> 
  1661. All arguments are optional. Arguments left empty are unchanged.
  1662.  
  1663. Examples:
  1664. </span><span class="style11">SetTimeDate ,,,1,15,1991</span><span class="style1">
  1665.     This sets the date to January 15, 1991 and leaves the time of day unchanged.
  1666. </span><span class="style11">SetTimeDate 15,0,0</span><span class="style1">
  1667.     This sets the time to 3:00:00 PM
  1668. </span></text>
  1669.     </content>
  1670.     <content>
  1671.         <layer>card</layer>
  1672.         <id>3</id>
  1673.         <text><span class="style3">ote:
  1674. The hour should be specified in 24 hour format.     Invalid integer arguments and arguments out of range return errors.</span></text>
  1675.     </content>
  1676.     <content>
  1677.         <layer>card</layer>
  1678.         <id>9</id>
  1679.         <text>Friday, February 1, 1991
  1680. 6:58:50 PM</text>
  1681.     </content>
  1682.     <content>
  1683.         <layer>card</layer>
  1684.         <id>1</id>
  1685.         <text>{    Name: SetTimeDate    }
  1686. {        This XCMD set the date and time of the Macintosh's clock. It is analagous to the ToolBox    }
  1687. {        routine, SetDateTime.    }
  1688. {    }
  1689. {    By : Len Saaf    }
  1690. {        January, 1991    }
  1691. {        ┬⌐1991 Raleigh Associates    }
  1692. {        Free for non-commercial use    }
  1693. {        Developed with THINK Pascal 3.0, ┬⌐1990 SYMANTEC Corp.    }
  1694. {    }
  1695. {    Form: SetTimeDate hour,minute,second,month,day,year    }
  1696. {        All arguments are optional. Arguments left blank are unchanged.    }
  1697. {    }
  1698. {    Example: SetTimeDate ,,,1,15,1991    }
  1699. {                    This sets the date to January 15, 1991 and leaves the time of day unchanged.    }
  1700. {                SetTimeDate 15,0,0    }
  1701. {                    This sets the time to 3:00:00 PM    }
  1702. {    }
  1703. {    Note:    }
  1704. {        The hour should be specified in 24 hour format.    }
  1705. {        Invalid integer arguments and arguments out of range return an error.    }
  1706. {    }
  1707. {    Include the following files in the project:    }
  1708. {        DRVRRuntime.lib    }
  1709. {        Interface.lib    }
  1710. {        SANE.p    }
  1711. {        SANELib.lib    }
  1712. {        HyperXCmd.p    }
  1713. {        HyperXLib.o    }
  1714. {        SetTimeDate.p    }
  1715.  
  1716. unit DummyUnit;
  1717.  
  1718. interface
  1719.     uses
  1720.         HyperXCmd, SANE;
  1721.  
  1722.     procedure Main (paramPtr: XCmdPtr);
  1723.  
  1724. implementation
  1725.  
  1726.     procedure Main (paramPtr: XCmdPtr);
  1727.         const
  1728.             Version = 'SetTimeDate XCMD 1.0 ┬⌐Raleigh Associates 1991 - Sets the date and time of the clock';
  1729.             Usage = 'Usage: SetTimeDate hour, minute, second, month, day, year All arguments optional.';
  1730.             MinArgs = 1;
  1731.             MaxArgs = 6;
  1732.         var
  1733.             str: str255;
  1734.  
  1735.         procedure CleanUpAndExit;
  1736.         begin
  1737. { nothing to clean up }
  1738.             exit(Main);
  1739.         end; { CleanUpAndExit }
  1740.  
  1741.         procedure Error (paramPtr: XCmdPtr; errStr: str255);
  1742.         begin
  1743.             errStr := concat('Error from SetTimeDate : ', errStr);
  1744.             paramPtr^.returnValue := PasToZero(paramPtr, errStr);
  1745.             CleanUpAndExit;
  1746.         end; { Error }
  1747.  
  1748.         function ReadInteger (paramPtr: XCmdPtr; paramNo: integer; var myInt: integer): Boolean;
  1749. { Reads a specified parameter and validates it using SANE routines }
  1750.             var
  1751.                 d: Decimal;
  1752.                 validPrefix: Boolean;
  1753.                 myExt: extended;
  1754.                 index: integer;
  1755.         begin
  1756.             if (paramNo > paramPtr^.paramCount) or (paramNo < 1) then
  1757.                 ReadInteger := False
  1758.             else
  1759.                 begin
  1760.                     index := 0;
  1761.                     CStr2Dec(CStrPtr(paramPtr^.params[paramNo]^), index, d, validPrefix);
  1762.                     if not validPrefix then
  1763.                         ReadInteger := False
  1764.                     else
  1765.                         begin
  1766.                             myExt := Dec2Num(d);
  1767.                             case ClassComp(myExt) of
  1768.                                 ZeroNum, NormalNum: 
  1769.                                     if (abs(myExt) < maxint) then
  1770.                                         begin
  1771.                                             myInt := round(myExt);
  1772.                                             ReadInteger := True;
  1773.                                         end
  1774.                                     else
  1775.                                         ReadInteger := False;
  1776.                                 otherwise
  1777.                                     ReadInteger := False;
  1778.                             end; { case }
  1779.                         end; { if }
  1780.                 end; { if }
  1781.         end; { ReadInteger }
  1782.  
  1783.         procedure InitProc (paramPtr: XCmdPtr); {  }
  1784.             var
  1785.                 str: str255;
  1786.         begin
  1787.             paramPtr^.returnValue := nil;
  1788.             paramPtr^.passflag := FALSE;
  1789.  
  1790.             if paramPtr^.paramCount = 1 then
  1791.                 begin
  1792.                     ZeroToPas(paramPtr, paramPtr^.params[1]^, str);
  1793.                     if (str = '!') or (str = '?') then
  1794.                         begin
  1795.                             if str = '!' then
  1796.                                 paramPtr^.returnValue := PasToZero(paramPtr, Version)
  1797.                             else
  1798.                                 paramPtr^.returnValue := PasToZero(paramPtr, Usage);
  1799.                             CleanUpAndExit;
  1800.                         end; { if }
  1801.                 end; { if }
  1802.  
  1803.             if (paramPtr^.paramCount < MinArgs) or (paramPtr^.paramCount > MaxArgs) then
  1804.                 Error(paramPtr, concat('Wrong number of arguments. ', Usage));
  1805.         end; { InitProc }
  1806.  
  1807.         procedure ReturnProc (paramPtr: XCmdPtr); { puts the values into returnValue }
  1808.         begin
  1809. { Nothing to return }
  1810.             CleanUpAndExit;
  1811.         end; { ReturnProc }
  1812.  
  1813.         procedure SetTimeDate (paramPtr: XCmdPtr);
  1814.             var
  1815.                 tHour, tMinute, tSecond, tMonth, tDay, tYear, mySecs: Longint;
  1816.                 myDateTime: DateTimeRec;
  1817.                 err: OSErr;
  1818.                 str: str255;
  1819.                 arg, pCount: integer;
  1820.         begin
  1821. { Get the time and make a copy of the elements }
  1822.             GetDateTime(mySecs);
  1823.             Secs2Date(mySecs, myDateTime);
  1824.             with myDateTime do
  1825.                 begin
  1826.                     tHour := hour;
  1827.                     tMinute := minute;
  1828.                     tSecond := second;
  1829.                     tMonth := month;
  1830.                     tDay := day;
  1831.                     tYear := year;
  1832.                 end; { with }
  1833.  
  1834. { read and check the arguments }
  1835.             pCount := paramPtr^.paramCount;
  1836.  
  1837.             ZeroToPas(paramPtr, paramPtr^.params[1]^, str);
  1838.             if length(str) > 0 then { ignore if the argument is empty }
  1839.                 if ReadInteger(paramPtr, 1, arg) then
  1840.                     if (arg >= 0) and (arg <= 23) then
  1841.                         tHour := arg
  1842.                     else
  1843.                         Error(paramPtr, 'Hour out of range')
  1844.                 else
  1845.                     Error(paramPtr, 'Invalid hour');
  1846.  
  1847.             if pCount >= 2 then
  1848.                 begin
  1849.                     ZeroToPas(paramPtr, paramPtr^.params[2]^, str);
  1850.                     if length(str) > 0 then
  1851.                         if ReadInteger(paramPtr, 2, arg) then
  1852.                             if (arg >= 0) and (arg <= 59) then
  1853.                                 tMinute := arg
  1854.                             else
  1855.                                 Error(paramPtr, 'Minute out of range')
  1856.                         else
  1857.                             Error(paramPtr, 'Invalid minute');
  1858.                 end; { if }
  1859.  
  1860.             if pCount >= 3 then
  1861.                 begin
  1862.                     ZeroToPas(paramPtr, paramPtr^.params[3]^, str);
  1863.                     if length(str) > 0 then
  1864.                         if ReadInteger(paramPtr, 3, arg) then
  1865.                             if (arg >= 0) and (arg <= 59) then
  1866.                                 tSecond := arg
  1867.                             else
  1868.                                 Error(paramPtr, 'Second out of range')
  1869.                         else
  1870.                             Error(paramPtr, 'Invalid second');
  1871.                 end; { if }
  1872.  
  1873.             if pCount >= 4 then
  1874.                 begin
  1875.                     ZeroToPas(paramPtr, paramPtr^.params[4]^, str);
  1876.                     if length(str) > 0 then
  1877.                         if ReadInteger(paramPtr, 4, arg) then
  1878.                             if (arg >= 1) and (arg <= 12) then
  1879.                                 tMonth := arg
  1880.                             else
  1881.                                 Error(paramPtr, 'Month out of range')
  1882.                         else
  1883.                             Error(paramPtr, 'Invalid month');
  1884.                 end; { if }
  1885.  
  1886.             if pCount >= 5 then
  1887.                 begin
  1888.                     ZeroToPas(paramPtr, paramPtr^.params[5]^, str);
  1889.                     if length(str) > 0 then
  1890.                         if ReadInteger(paramPtr, 5, arg) then
  1891.                             if (arg >= 1) and (arg <= 31) then
  1892.                                 tDay := arg
  1893.                             else
  1894.                                 Error(paramPtr, 'Day out of range')
  1895.                         else
  1896.                             Error(paramPtr, 'Invalid day');
  1897.                 end; { if }
  1898.  
  1899.             if pCount = 6 then
  1900.                 begin
  1901.                     ZeroToPas(paramPtr, paramPtr^.params[6]^, str);
  1902.                     if length(str) > 0 then
  1903.                         if ReadInteger(paramPtr, 6, arg) then
  1904.                             if (arg >= 1904) and (arg <= 2040) then
  1905.                                 tYear := arg
  1906.                             else
  1907.                                 Error(paramPtr, 'Year out of range')
  1908.                         else
  1909.                             Error(paramPtr, 'Invalid year');
  1910.                 end; { if }
  1911.  
  1912. { write back all elements }
  1913.             with myDateTime do
  1914.                 begin
  1915.                     hour := tHour;
  1916.                     minute := tMinute;
  1917.                     second := tSecond;
  1918.                     month := tMonth;
  1919.                     day := tDay;
  1920.                     year := tYear;
  1921.                 end; { with }
  1922.             Date2Secs(myDateTime, mySecs);
  1923.             err := SetDateTime(mySecs);
  1924.             if err <> noErr then
  1925.                 Error(paramPtr, 'SetDateTime (Toolbox) returned error');
  1926.         end; { SetTimeDate }
  1927.  
  1928.     begin { Main }
  1929.         InitProc(paramPtr);
  1930.         SetTimeDate(paramPtr);
  1931.         ReturnProc(paramPtr);
  1932.     end; { Main }
  1933.  
  1934. end. { implementation }</text>
  1935.     </content>
  1936.     <name>settimedate</name>
  1937.     <script>on idle
  1938. updatetime
  1939. pass idle
  1940. end idle
  1941.  
  1942. on updatetime
  1943. put the selectedchunk into mychunk
  1944. put the long date & return & the long time into cd fld "clock"
  1945. select mychunk
  1946. end updatetime</script>
  1947. </card>
  1948.  
  1949.  
  1950.